home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
5 Star Games: DOS Edition 2
/
5 Star Games - DOS Edition (1995)(Ready to Run).iso
/
dbc
/
dbcfix.skl
< prev
next >
Wrap
Text File
|
1993-08-25
|
21KB
|
901 lines
#define DBCFIX
#ifdef __TURBOC__
#include <conio.h>
#else
#include <graph.h>
#endif
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "db_lsc.h"
#include "db_types.h"
#include "db_conio.h"
#include "db_curs.h"
#include "db_date.h"
#include "db_dos.h"
#include "db_file.h"
#include "extfhc.h"
#include "db_funcs.h"
#include "db_heap.h"
#include "db_gvar.h"
#include "db_key.h"
#include "db_math.h"
#include "db_pswd.h"
#include "db_sets.h"
#include "db_str.h"
#include "db_win.h"
#include "db_util.h"
#include "db_tree.h"
#include "db_uwin.h"
ⁿUSESⁿ
ⁿIFDEF MANUALⁿ
#include "db_man.h"
ⁿENDDEFⁿ
ⁿIFDEF MEMOSⁿ
#include "db_mnu.h"
#include "db_memo.h"
ⁿELSEDEFⁿ
#include "db_mnu.h"
ⁿENDDEFⁿ
#define startintwin 7
#define numintwin 1
#define _Select 'S'
#define maxfilno ⁿmaxfilnoⁿ
#define maxkeyno ⁿmaxkeynoⁿ
str12 dbnames[maxfilno+1][maxkeyno+1] =
ⁿdbnamesⁿ;
byte keymode[maxfilno+1][maxkeyno+1] =
ⁿkeymodeⁿ;
byte keylen[maxfilno+1][maxkeyno+1] =
ⁿkeylenⁿ;
bool filinuse[maxfilno+1] = ⁿfilinuseⁿ;
bool filselected[maxfilno+1] = ⁿfilinuseⁿ;
bool menudriven = ⁿmenudrivenⁿ;
typedef long recnotyp[maxfilno+1];
ⁿIFDEF MEMOSⁿ
bool memos;
ⁿENDDEFⁿ
unsigned _stklen = 0x4000; /* Default stack of 16 K */
char tmpfilnam[13] = "DBFIX._-_";
winptr intwin[numintwin],
fixwin,
errwinp,
msgwinp;
int savds,
mtlen,
tv,
keyno,
keynum,
filno,
dbsize[maxfilno+1];
bool _abort,
fok,
full_fix;
uchar ch,
re_write_data[2];
byte line;
long pro_cnt,
cpy_cnt,
dup_cnt,
mem_cnt1,
mem_cnt2,
li,
recs;
string ws,
_tts;
keystr skey,
key;
pathstr prepend;
recnotyp newno,
recno;
datafile tempf,
*datf[maxfilno+1];
indexfile *idxkey[maxfilno+1][maxkeyno+1];
ⁿRECMODⁿ
void getarec(int fno); /* prototype */
/* ⁿFUNCMODⁿ If you include this code it includes your included */
/* Database functions */
void getarec(int fno)
{
switch (fno) {
ⁿGetRecⁿ
}
}
void getnewrec(int fno)
{
switch (fno) {
ⁿGetNewRecⁿ
}
}
strptr makekey(strptr sout, int fno, int kno)
{
string ks, ts;
ks[0] = '\0';
ⁿmakekeyⁿ
strcpy(sout,ks);
return(sout);
}
strptr keyexpr(strptr sout, int fno, int kno, string kvar)
{
string ts, ks;
byte tlen;
strcpy(ks,kvar);
tlen = strlen(ks);
ⁿkeyexprⁿ
ks[tlen] = Nul;
strcpy(sout,ks);
return(sout);
}
strptr getakey(strptr sout, int fno, int kno)
{
string tsout;
keyexpr(sout,fno,kno,makekey(tsout,fno,kno));
return(sout);
}
void addarec(void)
{
cpy_cnt++;
switch (filno) {
ⁿFIXADDRECⁿ
}
}
void openfiles(void)
{
int i,j;
bool oneopened;
string ts;
oneopened = False;
fok = True;
ⁿSIZESⁿ
for (i=1; i <= maxfilno; i++)
if ((fok) && filselected[i]) {
tmpfilnam[6] = (uchar)(i+64);
tmpfilnam[8] = '_';
datf[i] = db_malloc(sizeof(datafile));
strconcat(ts,prepend,dbnames[i][0],NULL);
openfile(datf[i],ts,dbsize[i]);
fok = ok;
if (fok) {
oneopened = True;
for (j=1; j <= maxkeyno; j++)
if ((fok) && (keylen[i][j] > 0)) {
tmpfilnam[8] = (uchar)(j+64);
idxkey[i][j] = db_malloc(sizeof(indexfile));
strconcat(ts,prepend,tmpfilnam,NULL);
makeindex(idxkey[i][j],ts,keylen[i][j],keymode[i][j]);
fok = (bool) (fok && ok);
}
}
else {
fok = True;
filselected[i] = False;
}
}
fok = (bool) (fok && oneopened);
}
void display_files(void)
{
int i,j;
string ts;
i = j = 1;
do {
if (filinuse[i]) {
pad(ts,dbnames[i][0],12,1);
writewxy(ts,112,(byte)(23+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
j++;
}
i++;
} while (i <= maxfilno);
}
void high(int j)
{
uchar cs[2];
writewxy(chstr(cs,31),159,(byte)(28+(((j-1)%4)*13)),(byte)(11+(((j-1)/4)*2)),fixwin);
writewxy(chstr(cs,16),159,(byte)(22+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
writewxy(chstr(cs,17),159,(byte)(35+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
writewxy(chstr(cs,30),159,(byte)(28+(((j-1)%4)*13)),(byte)(13+(((j-1)/4)*2)),fixwin);
}
void low(int j)
{
uchar cs[2];
writewxy(chstr(cs,'─'),31,(byte)(28+(((j-1)%4)*13)),(byte)(11+(((j-1)/4)*2)),fixwin);
writewxy(chstr(cs,'│'),31,(byte)(22+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
writewxy(chstr(cs,'│'),31,(byte)(35+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
writewxy(chstr(cs,'─'),31,(byte)(28+(((j-1)%4)*13)),(byte)(13+(((j-1)/4)*2)),fixwin);
}
void select_files(void)
{
int i, j, count, save_i, save_j;
string ts;
uchar pic[2];
i = j = 1;
do {
high(j);
count = 4;
save_i = i;
save_j = j;
do {
ch = upperch(getkey());
} while ((ch != Esc) && (ch != XeptKey) && (ch != _NO) &&
(ch != _Select) && (ch != _YES) &&
!((ch == RArr) && (i < 16) && (i < maxfilno)) &&
!((ch == LArr) && (i > 1)) &&
!((ch == UArr) && (i > 4)) &&
!((ch == DArr) && (i < 13) && (i < (maxfilno-3))));
switch (ch) {
case Esc :
case XeptKey : break;
case _NO :
case _YES :
chstr(re_write_data,ch);
dsp_fld(68,21,re_write_data,_Ch,chstr(pic,Pic_U),0,0,0,fixwin);
break;
case RArr :
low(j);
do
if (filinuse[++i]) j++;
while (!filinuse[i] && (i < maxfilno));
break;
case LArr :
low(j);
do
if (filinuse[--i]) j--;
while (!filinuse[i] && (i > 1));
break;
case DArr :
low(j);
count = 0;
do
if (filinuse[++i]) {
j++;
count++;
}
while ((count != 4) && (i < maxfilno));
break;
case UArr :
low(j);
count = 0;
do
if (filinuse[--i]) {
j--;
count++;
}
while ((count != 4) && (i > 1));
break;
case 'S' :
filselected[i] = (bool) (!filselected[i]);
if (filselected[i])
writewxy(pad(ts,dbnames[i][0],12,1),
112,(byte)(23+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
else
writewxy(pad(ts,dbnames[i][0],12,1),
31,(byte)(23+(((j-1)%4)*13)),(byte)(12+(((j-1)/4)*2)),fixwin);
break;
}
if ((count != 4) || (i > maxfilno) || (i < 1) || !filinuse[i]) {
i = save_i;
j = save_j;
}
} while ((ch != Esc) && (ch != XeptKey));
exitcode = ch;
}
void pick_files(void)
{
uchar pic[2];
hidewin(T_ON, fixwin);
chstr(re_write_data, _YES);
dsp_fld(68, 21, re_write_data, _Ch, chstr(pic,Pic_U), 0, 0, 0, fixwin);
display_files();
select_files();
hidewin(T_OFF,fixwin);
}
ⁿIFDEF MEMOSⁿ
void deletememos(void *fb, void *buf, int fno)
{
word w;
long mrec,
trec;
genbuf sbuf;
fldblk *fblk;
fldtyp *ftp;
byte *buffer;
buffer = buf;
fblk = fb;
getrec(&tempf, recno[fno], buf);
memmove(sbuf, buf, fblk->dsz);
w = 0;
do {
ftp = &(*fblk->farr)[w];
if (ftp->typ == _Memo) {
memmove(&mrec, ftp->faddr, 4);
while (mrec != 0) {
mem_cnt2--;
getrec(&tempf, mrec, buf);
memmove(&trec, &buffer[(fblk->dsz - 3) - 1], 4);
deleterec(&tempf, mrec);
mrec = trec;
}
memmove(buf,sbuf,fblk->dsz);
}
w++;
} while (w < fblk->numf);
}
void removememo(int fno, long drno)
{
recno[fno] = drno;
switch (fno) {
ⁿDELMEMOSⁿ
}
}
ⁿENDDEFⁿ
void display_fields(int fn, fldblk *fb, int f, string k, long *r, ptr buf,winptr w)
{
int next;
string ts;
uchar header[76],data1[76],data2[76];
strconcat(header, LSC_KeyValue, '"', k, '"', NULL);
data1[0] = data2[0] = '\0';
next = f;
getrec(&tempf, newno[fn], buf);
ts[0] = '\0';
do {
if ((*fb->farr)[next-1].typ != _Memo) /* check for -> not . */
strconcat(ts, ts, " │ ", (*fb->farr)[next-1].faddr, NULL);
next++;
} while ((strlen(ts) < 75) && (next <= fb->numf));
strcopy(data1,ts,0,75);
next = f;
getrec(&tempf, *r, buf);
ts[0] = '\0';
do {
if ((*fb->farr)[next-1].typ != _Memo)
strconcat(ts,ts," │ ",(*fb->farr)[next-1].faddr,NULL);
next++;
} while ((strlen(ts) < 75) && (next <= fb->numf));
strcopy(data2,ts,0,75);
pad(data1,data1,75,Right);
pad(data2,data2,75,Right);
writewxy(header,0,4,1,w);
writewxy(data1,78,4,2,w);
writewxy(data2,78,4,3,w);
}
void pickone(int fn, fldblk *fb, int *it, string k, long *r, ptr buf, winptr w)
{
uchar ch;
int fld;
string ts;
writewxy(pad(ts,LSC_DupMenu,78,Right),0,1,4,w);
fld = 1;
do {
display_fields(fn, fb, fld, k, r, buf, w);
switch (*it) {
case 1 :
writewxy("-->",0,1,2,w);
writewxy(" ",0,1,3,w);
break;
case 2 :
writewxy(" ",0,1,2,w);
writewxy("-->",0,1,3,w);
break;
}
do
ch = getkey();
while ((ch != Esc) && (ch != XeptKey) && (ch != Enter ) &&
(ch != UArr) && (ch != DArr) &&
!((ch == LArr) && (fld > 1)) &&
!((ch == RArr) && (fld < fb->numf)));
switch(ch) {
case UArr :
case DArr : *it = (*it % 2)+1; break;
case RArr : fld++; break;
case LArr : fld--; break;
case Esc : *it = 0; break;
case XeptKey : *it = 3; break;
}
} while ((ch != Esc) && (ch != XeptKey) && (ch != Enter));
}
void makechoice(int fno, int kno, string k)
{
int i,
choice;
long rec_no,
delrecno;
keystr tkey;
fldblk *fblk;
ptr buf;
string ts;
winptr choosewinp;
switch (fno) {
ⁿBUFFERⁿ
}
choice = 1;
findkey(idxkey[fno][kno], &rec_no, k);
if ((ok) && openwin(0,2,20,78,4,31,31,8,"─┐│┘─└│┌",TopCnt,"")) {
choosewinp = curwin;
choosewinp->disp = True;
dispwindow(choosewinp);
pickone(fno,fblk,&choice,k,&rec_no,buf,choosewinp);
switch (choice) {
case 0 :
cpy_cnt--;
dup_cnt++;
delrecno = rec_no;
ⁿIFDEF MEMOSⁿ
if (memos) removememo(fno, delrecno);
ⁿENDDEFⁿ
deleterec(&tempf, delrecno);
for (i=1; i <= maxkeyno; i++)
if (keylen[fno][i] > 0) {
delrecno = rec_no;
getakey(tkey, fno,i);
deletekey(idxkey[fno][i], &delrecno, tkey);
}
delrecno = newno[fno];
cpy_cnt--;
dup_cnt++;
ⁿIFDEF MEMOSⁿ
if (memos) removememo(fno, delrecno);
ⁿENDDEFⁿ
deleterec(&tempf, delrecno);
for (i=1; i < maxkeyno; i++)
if (keylen[fno][i] > 0) {
delrecno = newno[fno];
getakey(tkey, fno, i);
deletekey(idxkey[fno][i], &delrecno, tkey);
}
_abort = True;
break;
case 1 :
cpy_cnt--;
dup_cnt++;
delrecno = rec_no;
ⁿIFDEF MEMOSⁿ
if (memos) removememo(fno, delrecno);
ⁿENDDEFⁿ
deleterec(&tempf, delrecno);
for (i=1; i <= maxkeyno; i++)
if (keylen[fno][i] > 0) {
delrecno = rec_no;
getakey(tkey, fno, i);
deletekey(idxkey[fno][i], &delrecno, tkey);
}
getakey(tkey, fno, kno);
addkey(idxkey[fno][kno], &newno[fno], tkey);
if (!ok) {
audible(Error);
tv = max(max(strlen(LSC_DupFound)+3,strlen(LSC_KeyValue)+36),strlen(LSC_PressAnyKey));
if (openwin(0,(80-tv)/2,12,(byte)tv,3,78,78,8,"─┐│┘─└│┌",TopCnt,"")){
errwinp = curwin;
errwinp->disp = True;
dispwindow(errwinp);
strconcat(ts,LSC_DupFound," ",istr(ts,(long)kno,2),NULL);
writewxy(ts,78,1,1,errwinp);
strconcat(ts,LSC_KeyValue," ",strcopy(ts,tkey,1,35),NULL);
writewxy(ts,78,1,2,errwinp);
writewxy(LSC_PressAnyKey,78,1,3,errwinp);
ch = getkey();
closewin(&errwinp);
}
}
break;
case 2 :
cpy_cnt--;
dup_cnt++;
delrecno = newno[fno];
ⁿIFDEF MEMOSⁿ
if (memos) removememo(fno, delrecno);
ⁿENDDEFⁿ
deleterec(&tempf, delrecno);
for (i=1; i < maxkeyno; i++)
if (keylen[fno][i] > 0) {
delrecno = newno[fno];
getakey(tkey, fno, i);
deletekey(idxkey[fno][i], &delrecno, tkey);
}
_abort = True;
break;
case 3 :
break;
}
closewin(&choosewinp);
}
}
ⁿIFDEF MEMOSⁿ
bool anymemos(ptr fb)
{
word w;
fldblk *fblk;
fblk = fb; /* checkout -> for . */
w = 1;
while (((*fblk->farr)[w-1].typ != _Memo) && (w < fblk->numf)) w++;
return((bool) ((*fblk->farr)[w-1].typ == _Memo));
}
void addmemos(ptr fb, ptr buf)
{
word w;
fldblk *fblk;
long first,
savm,
tr1,
tr2;
genbuf sbuf;
fldtyp *ftp;
byte *buffer;
buffer = buf;
fblk = fb;
w = 1;
while (w <= fblk->numf) {
while ((w <= fblk->numf) && ((*fblk->farr)[w-1].typ != _Memo)) w++;
ftp = &(*fblk->farr)[w-1];
if (w <= fblk->numf) {
first = 0;
memmove(&savm, ftp->faddr, 4);
memmove(sbuf, buf, fblk->dsz);
if (savm) addrec(&tempf, &tr1, buf);
while (savm) {
mem_cnt2++;
if (!first) first = tr1;
getrec(datf[filno], savm, buf);
memmove(&savm, &buffer[(fblk->dsz-3)-1], 4);
if (savm) addrec(&tempf, &tr2, buf);
else tr2 = 0;
memmove(&buffer[(fblk->dsz-3)-1],&tr2,4);
putrec(&tempf,tr1,buf);
tr1 = tr2;
}
memmove(buf,sbuf,fblk->dsz);
memmove(ftp->faddr,&first,4);
}
w++;
}
}
ⁿENDDEFⁿ
strptr amount_done(strptr sout)
{
string ts;
float howManyBlocks, howManyProcessed, howManyRecords;
howManyProcessed = li;
howManyRecords = recs;
howManyBlocks = (float)fround((double)(howManyProcessed/howManyRecords)*55);
fillstr(ts,(int)howManyBlocks,'█');
strcpy(sout,ts);
return(sout);
}
void deleteTempIndexes(void)
{
string mts;
for (filno=filno; filno <= maxfilno; filno++) if (filselected[filno]) {
tmpfilnam[6] = (uchar)(filno+64);
tmpfilnam[8] = '_';
for (keyno=1; keyno<=maxkeyno; keyno++)
if (keylen[filno][keyno] > 0) {
tmpfilnam[8] = (uchar)(keyno+64);
closeindex(idxkey[filno][keyno]);
db_free(idxkey[filno][keyno]);
unlink(strconcat(mts,prepend,tmpfilnam,NULL));
}
}
}
void main(void)
{
uchar *mtp;
string mts,
mts1;
strptr tp;
extfhc_init();
db_curs_init();
db_date_init();
db_funcs_init();
db_heap_init();
db_gvar_init();
db_key_init();
db_pswd_init();
db_win_init();
db_util_init();
db_tree_init();
ⁿIFDEF MEMOSⁿ
db_mnu_init();
db_memo_init();
ⁿELSEDEFⁿ
db_mnu_init();
ⁿENDDEFⁿ
clrscr();
line = 1;
ignoresizediff = True;
/*
ⁿIFDEF MUSERⁿ
filemode = (int)0x12;
ⁿENDDEFⁿ
*/
/* CHECK WITH ALEX !!!!!!!!!!!!
readinternal("DB_UTIL.IWF",startintwin,numintwin,intwin);
readlang("DBLANG.LAN","DBPFIXSK",&langp);
*/
initedit();
initindex();
if (menudriven && !dbcaller) {
audible(Error);
dspmsge(LSC_BaseError,LSC_MenuDriven,4.0);
}
else if (!validpath()) {
audible(Error);
dspmsge(LSC_BaseError,LSC_AbortBadPath,4.0);
}
else {
fixwin = FixFilesWin();
strip(prepend,datapath);
tp = strchr(prepend,'\0');
if (tp != NULL) if (*(tp-1) != '\\') {
*tp++ = '\\'; *tp = '\0';
}
pick_files();
if (exitcode == QitKey) goto fix_exit;
full_fix = (bool) (re_write_data[0] == _YES);
mtlen = strlen(LSC_Initializing);
if (openwin(0,(80-mtlen)/2,12,(byte)mtlen,1,31,31,8,"─┐│┘─└│┌",TopCnt,"")){
msgwinp = curwin;
msgwinp->disp = True;
dispwindow(msgwinp);
writewxy(LSC_Initializing,0,1,1,msgwinp);
hidewin(T_ON,msgwinp);
openfiles();
closewin(&msgwinp);
}
if (fok) {
savds = deltas;
deltas = 0;
strconcat(fixwin->title,LSC_FixModule,"ⁿMODNAMEⁿ",NULL);
clrwin(fixwin);
hidewin(T_ON,fixwin);
writewxy(LSC_ProcessedHdr,0,1,1,fixwin);
for (filno=1; filno <= maxfilno; filno++) if (filselected[filno]) {
ⁿIFDEF MEMOSⁿ
switch (filno) {
ⁿANYMEMOSⁿ
}
ⁿENDDEFⁿ
writewxy(centre(mts,LSC_Any2Abort,78),0,1,23,fixwin);
line++;
writewxy(dbnames[filno][0],0,1,line,fixwin);
if (full_fix) {
tmpfilnam[6] = (uchar)(filno+64);
tmpfilnam[8] = '_';
makefile(&tempf, strconcat(mts,prepend,tmpfilnam,NULL), dbsize[filno]);
if (!ok) {
audible(Error);
dspmsge(LSC_BaseError,strconcat(mts,LSC_NoCreateTemp," ",tmpfilnam,NULL),4.0);
goto fix_exit;
}
}
recno[filno] = newno[filno] = 0;
recs = filelen(datf[filno])-1;
pro_cnt = recs;
cpy_cnt = dup_cnt = mem_cnt1 = mem_cnt2 = 0;
for (keyno=1; keyno <= maxkeyno; keyno++) if (keylen[filno][keyno] != 0) {
if ((keyno > 1) && full_fix) recs = filelen(&tempf) - 1;
writewxy("░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░",0,24,line,fixwin);
for (li=1; li <= recs; li++) {
writewxy(amount_done(mts),0,24,line,fixwin);
_abort = False;
recno[filno] = newno[filno] = li;
if ((keyno == 1) || !full_fix) getarec(filno);
else getnewrec(filno);
switch (filno) {
ⁿSETOKⁿ
}
if (ok) {
if ((keyno == 1) && full_fix) {
ⁿIFDEF MEMOSⁿ
if (memos)
switch (filno) {
ⁿADDMEMOSⁿ
}
ⁿENDDEFⁿ
addarec();
}
else {
switch (filno) {
ⁿCHKRECⁿ
}
}
if (ok) {
getakey(key,filno,keyno);
if (full_fix)
addkey(idxkey[filno][keyno],&newno[filno],key);
else
addkey(idxkey[filno][keyno],&recno[filno],key);
if (!ok) {
audible(Error);
tv = max(strlen(LSC_DupFound)+3,strlen(LSC_KeyValue)+36);
if (openwin(0,(80-tv)/2,8,(byte)tv,3,78,78,8,"─┐│┘─└│┌",TopCnt,"")) {
errwinp = curwin;
errwinp->disp = True;
dispwindow(errwinp);
strconcat(mts,LSC_DupFound," ",istr(mts,(long)keyno,2),NULL);
writewxy(mts,78,1,1,errwinp);
strconcat(mts,LSC_KeyValue," ",strcopy(mts,key,0,35),NULL);
writewxy(mts,78,1,3,errwinp);
gotoxy(1,1);
if (full_fix) makechoice(filno,keyno,key);
else dspmsge("",LSC_PressAnyKey,4.0);
closewin(&errwinp);
}
}
if (kpressed()) {
audible(Warning);
ch = getkey();
tv = max(strlen(LSC_XeptOrEsc),strlen(LSC_PartialFixWarn));
if (openwin(0,(80-tv)/2,5,(byte)tv,3,78,78,8,"─┐│┘─└│┌",TopCnt,"")) {
errwinp = curwin;
errwinp->disp = True;
dispwindow(errwinp);
writewxy(centre(mts,LSC_XeptOrEsc,tv),78,1,1,errwinp);
writewxy(centre(mts,LSC_PartialFixWarn,tv),78,1,3,errwinp);
do
ch = getkey();
while ((ch != Esc) && (ch != XeptKey));
closewin(&errwinp);
}
if (ch == Esc) {
closefile(datf[filno]);
db_free(datf[filno]);
if (full_fix) {
closefile(&tempf);
unlink(strconcat(mts,prepend,tmpfilnam,NULL));
}
deleteTempIndexes();
dspmsge("",LSC_ClosingFile,4.0);
goto fix_exit;
}
}
}
writewxy(istr(mts,li,6),0,14,line,fixwin);
}
}
writewxy(istr(mts,pro_cnt-mem_cnt1,6),0,14,line,fixwin);
}
closefile(datf[filno]);
db_free(datf[filno]);
tmpfilnam[6] = (uchar)(filno+64);
tmpfilnam[8] = '_';
if (full_fix) {
strconcat(ws,LSC_CopiedEquals," ",strip(mts,istr(mts,cpy_cnt,6)),",",NULL);
pad(ws,ws,15,Right);
strconcat(mts,LSC_PurgedEquals," ",strip(mts,istr(mts,
pro_cnt-mem_cnt1-cpy_cnt-dup_cnt,6)),",",NULL);
strconcat(ws,ws,pad(mts,mts,14,Right),NULL);
strconcat(mts,LSC_DeletedEquals," ",strip(mts,istr(mts,dup_cnt,6)),
" ",LSC_DupsEquals,NULL);
strconcat(ws,ws,pad(mts,mts,26,Right),NULL);
writewxy(ws,0,24,line,fixwin);
closefile(&tempf);
unlink(strconcat(mts,prepend,dbnames[filno][0],NULL));
rename(strconcat(mts,prepend,tmpfilnam,NULL),
strconcat(mts1,prepend,dbnames[filno][0],NULL));
}
for (keyno=1; keyno<=maxkeyno; keyno++)
if (keylen[filno][keyno] > 0) {
tmpfilnam[8] = (uchar)(keyno+64);
closeindex(idxkey[filno][keyno]);
db_free(idxkey[filno][keyno]);
unlink(strconcat(mts,prepend,dbnames[filno][keyno],NULL));
rename(strconcat(mts,prepend,tmpfilnam,NULL),
strconcat(mts1,prepend,dbnames[filno][keyno],NULL));
}
}
strconcat(mts,"\xFF\x01",chstr(mts,fixwin->mwid),"\x20",NULL);
writewxy(mts,0,1,23,fixwin);
audible(Warning);
message(NULL,LSC_Finished);
deltas = savds;
ch = getkey();
message(NULL,"");
fix_exit:;
hidewin(T_OFF,fixwin);
}
else {
audible(Error);
dspmsge(LSC_ErrNeededFiles,LSC_ErrMissingFile,4.0);
ⁿIFDEF MUSERⁿ
dspmsge("",LSC_DeniedFiles,4.0);
ⁿENDDEFⁿ
}
}
clrscr();
}